<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" 
xmlns:p="http://primefaces.org/ui">
<h:head>
<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/template/css.css" media="all" />
<title>QueroTeto</title>
</h:head>
<h:body>
	<div id="corpo">
		<ui:include src="/template/topo.xhtml"/>
		<ui:include src="/template/menu.xhtml"/>
		<div id="slide"></div>
		<div id="conteudo">
			<div id="centro">
				<h1><b>ADMINISTRADOR</b></h1>
				#{cadastroPropagandaBean.msg}
				
				
				<h:form>
				<p:dataTable rendered="#{cadastroPropagandaBean.mostraTabela}" value="#{cadastroPropagandaBean.propagandaDao.lista}" var="propaganda" >
				
					<p:column headerText="Minhas propagandas">

						<h:outputText value="#{propaganda.assunto}"/>

					</p:column>
					<p:column>
						<h:commandButton value="Visualizar" action="#{cadastroPropagandaBean.visualizar}">
							<f:param name="id" value="#{propaganda.id}" />
						</h:commandButton>						
					</p:column>
					
					<p:column>
						<h:commandButton value="Editar" type="submit" action="#{cadastroPropagandaBean.editar}" ajax="false">
    					<f:param name="id" value="#{propaganda.id}" />
    					</h:commandButton>
						
												
					</p:column>
					
					<p:column>
						<h:commandButton value="Excluir" action="#{cadastroPropagandaBean.excluir}" onclick="return confirm('Deseja realmente Excluir?')">
							<f:param name="id" value="#{propaganda.id}" />
						</h:commandButton>						
					</p:column>
					
					
				
				</p:dataTable>
				</h:form>		
			<br />
			
			<h3>#{cadastroServicoBean.msg}</h3>
			<h:form>
				<p:dataTable rendered="#{cadastroServicoBean.mostraTabela}" value="#{cadastroServicoBean.servicoDao.lista}" var="servico" >
				
					<p:column headerText="Serviços básicos cadastrados">

						<h:outputText value="#{servico.nome}"/>

					</p:column>
					
					<p:column>
						<h:commandButton value="Visualizar" action="#{cadastroServicoBean.visualizar}">
							<f:param name="id" value="#{servico.id}" />
						</h:commandButton>						
					</p:column>
					
					<p:column>
						<h:commandButton value="Editar" type="submit" action="#{cadastroServicoBean.editar}" ajax="false">
    					<f:param name="id" value="#{servico.id}" />
    				</h:commandButton>
						
												
					</p:column>
					
					<p:column>
						<h:commandButton value="Excluir" action="#{cadastroServicoBean.excluir}" onclick="return confirm('Deseja realmente Excluir?')">
							<f:param name="id" value="#{servico.id}" />
						</h:commandButton>						
					</p:column>
					
					
				
				</p:dataTable>
				</h:form>		
			
			
			
			
			
			
			
			</div>
			<div id="direita" align="center">
				<h:form>    
					    <h:panelGrid columns="1" cellpadding="5">
							<p:commandButton value="Cadastrar propaganda" action="#{cadastroPropagandaBean.paginaPropaganda}" />
								<p:commandButton value="Cadastrar serviço básico" action="#{cadastroServicoBean.paginaCadastroServico}" />
   			      		
   			      	</h:panelGrid>    
				</h:form>		
			</div>
		</div>
		<div id="both" align="center"></div>
		<ui:include src="/template/rodape.xhtml"/>
	</div>
	
	
	
	
</h:body>
</html>

